<?php

namespace app\api\controller\pifa;

use app\common\controller\Api;
use think\Config;
use think\Db;
use think\Validate;
use think\Session;
use fast\WechatMini;
use addons\third\model\Third;
use think\Log;
use think\Request;
use fast\Http;
use think\Exception;
use addons\third\library\Service;
use app\api\model\Peisong;
/**
 * 首页接口
 */
class Jingxiao extends Api
{
    protected $noNeedLogin = ['login','getconfig','getMendian1','token','laobaninit'];
    protected $noNeedRight = ['*'];


    public function _initialize()
    {
        $this->token = $this->request->post('token');

        parent::_initialize();

    } 

    public function userlist()
    {   



        $map['inv_id'] = $this->auth->id;
        $list = Db::table('fa_user')
                    ->alias('a')
                    ->field('a.nickname,a.id,a.avatar,a.mobile,w.consignee,a.createtime,a.yongjin')
                    ->join('fa_pifa_sqmd w','a.id = w.user_id','LEFT')
                    ->where($map)
                    ->order('createtime desc')
                    ->paginate(12);

        $list = $list->toArray();

        foreach ($list['data'] as $key => $value) {
            $list['data'][$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
        }

        $this->success("成功", $list);
    }


    


    
}
